package il.ac.tau.cvws.scrabblesidekick.shared.datatype.game;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Rack implements Recognizable, Serializable
{
	private static final long serialVersionUID = 1L;
	
	private final List<Tile> tiles;
	
	public Rack()
	{
		tiles = new ArrayList<Tile>();
	}
	
	public Rack(List<Tile> tiles) 
	{
		this.tiles = tiles;
	}

	public List<Tile> getTiles()
	{
		return tiles;
	}
	
	public int rackLength()
	{
		return tiles.size();
	}
	
	public int[] getTileIndices()
	{
		int[] tileIndices = new int[tiles.size()];
		
		for(int i = 0; i< tileIndices.length; i++)
		{
			tileIndices[i] = tiles.get(i).getIndex();
		}
		
		return tileIndices;
	}
}
